/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rie06.openvoip.client.IHM.communication;

import com.rie06.openvoip.client.Contact;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.*;
import javax.swing.*;
import org.apache.log4j.*;

/**
 *
 * @author Sylvain
 */
public class PanelAddListContactConversation extends JPanel {

    private WindowListAddContactConversation windowListAddContactConversation;
    private CommunicationController communicationController;
    private JTextArea listChoiceContact;
    private JScrollPane scrollContactListConversation;
    private JButton buttonAddContactConversation;
    private JLabel labelNom;
    private static final Logger logger = Logger.getLogger(PanelAddListContactConversation.class);

    public PanelAddListContactConversation(WindowListAddContactConversation windowListAddContactConversation, CommunicationController communicationController) {

        this.windowListAddContactConversation = windowListAddContactConversation;
        this.communicationController = communicationController;

        HashMap m = (HashMap) communicationController.getInterfaceClient().getClient().getContactList();
        for (Iterator it = m.entrySet().iterator(); it.hasNext();) {
 
            Map.Entry<UUID, Contact> entry = (Map.Entry<UUID, Contact>) it.next();
             UUID uuid = entry.getKey();
             Contact contact = entry.getValue();
                
            if(contact.isOnline() && !windowListAddContactConversation.getWindowDialog().getConversation().getContactList().containsKey(contact.getUuid())){
    
                PanelAddListContactConversationExtended pa = new PanelAddListContactConversationExtended(communicationController, this, contact);
                this.add(pa);
           }
        }

    }
    
    public WindowListAddContactConversation getWindowListAddContactConversation() {
        return windowListAddContactConversation;
    }

    public JTextArea getListChoiceContact() {
        return listChoiceContact;
    }
    
    
}
